//
//  BaseNavigationController.m
//  TestApplication
//
//  Created by Hanlingyu on 16/9/14.
//  Copyright © 2016年 ltq. All rights reserved.
//

#import "BaseNavigationController.h"
#import "TAMacro.h"
@interface BaseNavigationController ()

@end

@implementation BaseNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationController.navigationBarHidden = YES;
    // Do any additional setup after loading the view.
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    //判断当前控制器中的自控制器个数
    if (self.viewControllers.count > 0) {
        //进入到次级界面count大于0，这时隐藏
        self.viewControllers.firstObject.hidesBottomBarWhenPushed = YES;
//        self.hidesBottomBarWhenPushed = YES;
    }
    [super pushViewController:viewController animated:animated];
}


- (nullable UIViewController *)popViewControllerAnimated:(BOOL)animated{
    if (self.viewControllers.count == 2) {
        self.viewControllers.firstObject.hidesBottomBarWhenPushed = NO;
    }
    [super popViewControllerAnimated:animated];
    return self;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
